package com.jxau.mall.demo.controller;

import com.jxau.mall.demo.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: shop
 * @Belongspackage: com.jxau.mall.demo.controller
 * @Author: guojiani
 * @CreateTime: 2025-03-29 20:14
 * @Description: TODO
 * @Version: 1.0
 */
@RestController //PersonController personController =  new PersonController();
public class PersonController {
    @Autowired // 注解：从容器中取 Person 对象
    //@Qualifier(value = "p") //指定名字
    //@Resource(name="p")//指定名字并从容器中获取对象，相当于上面两个注解
    private Person person;
    @GetMapping("/person") // 映射 URI
    public String getPerson(){
//        person.setName("张三");
//        person.setAge(18);
        return person.toString();
    }
}
